package com.aspose.cells.b.a.d;

import java.io.File;
import java.io.IOException;

public final class zk {
   public static final char a;
   public static final String b;
   private static final char[] c;
   private static String d;

   public static String a(String var0) {
      if (var0 == null) {
         return null;
      } else {
         int var1 = var0.indexOf(":");
         if (var1 != -1) {
            return var0.substring(0, var1 + 1) + b;
         } else {
            return var0.charAt(0) != '/' && var0.charAt(0) != '\\' ? "" : b;
         }
      }
   }

   public static String b(String var0) {
      if (!com.aspose.cells.a.e.zg.a(var0)) {
         return "";
      } else {
         char var1 = var0.charAt(var0.length() - 1);
         if (a(var1)) {
            return "";
         } else {
            File var2 = new File(var0);
            return var2.getName();
         }
      }
   }

   public static String c(String var0) {
      if (!com.aspose.cells.a.e.zg.a(var0)) {
         return "";
      } else {
         char var1 = var0.charAt(var0.length() - 1);
         if (a(var1)) {
            return "";
         } else {
            File var2 = new File(var0);
            String var3 = var2.getName();
            int var4 = var3.lastIndexOf(46);
            return var4 > 0 ? var3.substring(0, var4) : var3;
         }
      }
   }

   public static String d(String var0) {
      if (!com.aspose.cells.a.e.zg.a(var0)) {
         return "";
      } else {
         File var1 = new File(var0);
         String var2 = var1.getName();
         int var3 = var2.lastIndexOf(46);
         if (var3 > 0) {
            return var2.substring(var3);
         } else {
            return var3 == 0 ? var2 : "";
         }
      }
   }

   public static String e(String var0) {
      if (!com.aspose.cells.a.e.zg.a(var0)) {
         return "";
      } else {
         File var1 = new File(var0);
         char var2 = var0.charAt(var0.length() - 1);
         if (a(var2) && com.aspose.cells.a.e.zg.a(var1.getName())) {
            return var1.getPath();
         } else {
            String var3 = var1.getParent();
            return var3 == null ? "" : var3;
         }
      }
   }

   public static String a(String var0, String var1) {
      if (var0 == null) {
         throw new NullPointerException("parent");
      } else if (var1 == null) {
         throw new NullPointerException("child");
      } else if (com.aspose.cells.a.e.zj.a(var1)) {
         return var1;
      } else {
         if ("".equals(var0)) {
            var0 = null;
         }

         try {
            File var2 = new File(var0, var1);
            return var2.isAbsolute() ? var2.getCanonicalPath() : var2.getPath();
         } catch (IOException var3) {
            throw new RuntimeException(var3);
         }
      }
   }

   public static String a() {
      if (d == null) {
         d = System.getProperty("java.io.tmpdir");
      }

      return d;
   }

   public static boolean f(String var0) {
      return (new File(var0)).isAbsolute();
   }

   private static boolean a(char var0) {
      return var0 == '\\' || var0 == '/';
   }

   static {
      a = File.separatorChar;
      b = File.separator;
      c = new char[]{'"', '<', '>', '|', '\u0000', '\u0001', '\u0002', '\u0003', '\u0004', '\u0005', '\u0006', '\u0007', '\b', '\t', '\n', '\u000b', '\f', '\r', '\u000e', '\u000f', '\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017', '\u0018', '\u0019', '\u001a', '\u001b', '\u001c', '\u001d', '\u001e', '\u001f'};
   }
}
